

Array.prototype.myPush2 = function (...args) {
    const len = this.length
    for (let i = len; i < len + args.length; i ++) {
        this[i] = args[i - len]
    }
    return this.length
}
const arr = [1,2,3]
console.log(arr.myPush2(4, 5, 6));
console.log(arr)
